package comment

import (
	"vrcm/src/vrcm/common/models"
)

type Comment struct {
	models.Model

	TenantId     string    `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	BasicId      int       `json:"basic_id" gorm:"type:int unsigned;comment:直播间id"`
	BindId       string    `json:"bind_id" gorm:"type:varchar(100);comment:关联id"`
	ParentId     int       `json:"parent_id" gorm:"type:bigint unsigned;comment:父级id"`
	ToCommentId  int       `json:"to_comment_id" gorm:"type:bigint unsigned;comment:回复目标评论id"`
	Likes        int       `json:"likes" gorm:"type:int;comment:点赞数"`
	CommentIp    string    `json:"comment_ip" gorm:"type:varchar(20);comment:评论ip"`
	Account      string    `json:"account" gorm:"type:varchar(50);comment:账户"`
	UserName     string    `json:"user_name" gorm:"type:varchar(50);comment:用户昵称"`
	Content      string    `json:"content" gorm:"type:varchar(300);comment:评论内容"`
	HeadImgUrl   string    `json:"head_img_url" gorm:"type:varchar(300);comment:用户头像"`
	CommentState int       `json:"comment_state" gorm:"type:tinyint;comment:1评论状态 1待审核 2未通过 3通过 4禁言"`
	CommentType  int       `json:"comment_type" gorm:"type:tinyint;comment:1全球直播 2直播调度"`
	MarkTime     int       `json:"mark_time" gorm:"type:int;comment:标注时间"`
	Replies      []Comment `gorm:"-"`
	ReplyNum     int       `gorm:"-"comment:"回复数"`
	FirstId      int       `json:"first_id" gorm:"type:int unsigned;comment:父级id"`
	models.ModelTime
	models.ControlBy
}

func (Comment) TableName() string {
	return "comment"
}

func (e *Comment) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *Comment) GetId() interface{} {
	return e.Id
}

type CommentBlack struct {
	models.Model

	TenantId string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	BasicId  int    `json:"basic_id" gorm:"type:int unsigned;comment:直播间id"`
	Account  string `json:"account" gorm:"type:varchar(20);comment:评论ip"`
	models.ModelTime
	models.ControlBy
}

func (CommentBlack) TableName() string {
	return "comment_black"
}
